
{% extends 'backweb/base.html' %}

{% block title %}
后台管理系统
{% endblock %}

{% block content %}

<section class="rt_wrap content mCustomScrollbar">
<div class="rt_content">
    <div class="page_title">
    <h2 class="fl">文章列表</h2>
    </div>
    <section class="mtb">
    <select class="select" style="height:38px">
    <option>下拉菜单</option>
    <option>菜单1</option>
    </select>
    <input type="text" class="textbox textbox_225" placeholder="输入文章关键词或编号..."/>
    <input type="button" value="查询" class="group_btn"/>
    </section>
    <table class="table">
    <tr>
    <th>编号</th>
    <th>文章名称</th>
    <th>描述</th>
    <th>缩略图</th>
    <th>是否展示</th>
    <th>是否推荐</th>
    <th>上传日期</th>
    <th>类型</th>
    <th>操作</th>
    </tr>
    {% for article in page %}
    <tr>
    <td class="center">{{ article.id }}</td>
    <td class="center"><a>{{ article.title }}</a></td>
    <td class="center"><a>{{ article.desc }}</a></td>
    <td class="center"><a><img width="50px" height="50px" src="/meida/{{ article.image_url }}"></a></td>
    <td class="center"><a title="否" class="link_icon">
        {% if article.is_show %}
            &#89;
        {% else %}
            &#88;
        {% endif %}
    </a></td>
    <td class="center"><a title="是" class="link_icon">
        {% if article.is_recommend %}
            &#89;
        {% else %}
            &#88;
        {% endif %}
    </a></td>
    <td class="center"><a>{{ article.create_time }}</a></td>
    <td class="center" ><a>{{ article.atype.name }}</a></td>
    <td class="center">
        {% if user.is_superuser %}
        <a href="{% url 'backweb:edit' %}" title="编辑" class="link_icon">&#101;</a>
        <a href="/backweb/delete?id={{ article.id }}" title="删除" class="link_icon">&#100;</a>
        {% endif %}
        {% if 'EDITARTICLE' in user.user_permissions %}
         <a href="{% url 'backweb:edit' %}" title="编辑" class="link_icon">&#101;</a>
        {% endif %}
        {% if 'DELETEARTICLE' in user.user_permissions %}
        <a href="/backweb/delete?id={{ article.id }}" title="删除" class="link_icon">&#100;</a>
        {% endif %}
    </td>
    </tr>
    {% endfor %}
    </table>
    <aside class="paging">
        {% if page.has_previous %}
        <a href="{% url 'backweb:index' %}?page={{ page.previous_page_number }}">上一页</a>
        {% endif %}
        <a href="{% url 'backweb:index' %}?page=1">第一页</a>
        {% for i in page.paginator.page_range %}
            <a href="{% url 'backweb:index' %}?page={{ i }}">{{ i }}</a>
        {% endfor %}
        {% if page.has_next %}
        <a href="{% url 'backweb:index' %}?page={{ page.next_page_number }}">下一页</a>
        {% endif %}
    <a href="{% url 'backweb:index' %}?page={{ page.paginator.num_pages }}">最后一页</a>
    </aside>
</div>
</section>
{% endblock %}

